package cz.muni.fi.pa165.soap.client.manager;

import cz.muni.fi.pa165.soap.CustomerDTO;
import cz.muni.fi.pa165.soap.CustomerService;
import cz.muni.fi.pa165.soap.CustomerSoapService;
import java.util.List;

/**
 *
 * @author shifty
 */
public class CustomerManager {
    
    private List<CustomerDTO> customers;
    private CustomerSoapService css;
    
    public CustomerManager() {
        css = new CustomerService().getCustomerSoapServiceImplPort();
    }
    
    public void setEmployees(List<CustomerDTO> list) {
        customers=list;
    }
    
    public CustomerDTO getCustomerById(Long id) {
        return css.getCustomer(id);
    }
    
    public List<CustomerDTO> loadCustomers() {
        return css.getCustomers();
    }

    public void removeCustomer(Long id) {   
        CustomerDTO cus = new CustomerDTO();
        cus.setId(id);
        css.removeCustomer(cus);
    }
    
    public void createCustomer(CustomerDTO c) {
        css.createCustomer(c);
    }
    
    public void updateCustomer(CustomerDTO c) {
        css.updateCustomer(c);
    }
    
}
